<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./index.js"></script>
    <script>
        /* 验证 */
        //父类
        function Person(name, age, friends) {
            this.name = name
            this.age = age
            this.friends = friends
        }

        Person.prototype.running = function () {
            console.log("running~")
        }

        Person.prototype.eating = function () {
            console.log("eating~")
        }


        //学生
        function Student(name, age, friends, sno, score) {
            Person.call(this, name, age, friends)
            this.sno = sno;
            this.score = score;
        }

        inheritPrototype(Student, Person)


        Student.prototype.studying = function () {
            console.log("studying~")
        }


        var stu = new Student("wyd", 18, ["kobe"], 111, 100)
        console.log(stu)
        stu.studying()
        stu.running()
        stu.eating()
    </script>
</body>

</html>